<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="ism" uri="http://www.baseproj.org/rd/html" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <ism:link rel="stylesheet" type="text/css" href="../skins/main.css" debug="false"/>
    <ism:link rel="stylesheet" type="text/css" href="../js/artDialog4.1.7/skins/green.css"/>
</head>
<body class="popUp chooseTO">
<form>
    <div class="dataGrid">
        <table id="reportQuestionTable">
            <tbody class="tableHover" id="reportQuestionBody">
            <s:iterator value="questionList" status="number">
                <tr>
                    <th></th>
                    <th></th>
                </tr>
                <tr>
                    <td width="80">
                        <s:property value="name"/>
                    </td>

                    <td>
                        <s:if test="optionList != null && optionList.size > 0">
                            <select>
                                <s:iterator value="optionList" status="number">
                                    <option value ="key" value="<s:property value='value'/>"
                                            selected = "<s:if test=""></s:if>"><s:property value="value"/></option>
                                </s:iterator>
                            </select>
                        </s:if>
                        <s:else>
                            <input type="text" value="<s:property value='resultAnswer["name"]' />"/>
                        </s:else>
                    </td>
                </tr>
            </s:iterator>
            </tbody>
        </table>

        <table id="reportAoiTable2">
            <tbody class="tableHover" id="reportAoiBody2">
            <tr>
                <th>AOI</th>
                <th>指标</th>
                <th>测试值</th>
                <th>参考值</th>
            </tr>
            <s:iterator value="reportList" status="number">
                <tr>
                    <td>
                        <s:property value="zb"/>
                    </td>
                    <td>
                        <s:property value="zs"/>
                    </td>
                    <td>
                        <s:property value="cs"/>
                    </td>
                    <td>
                        <s:property value="st"/>-<s:property value="et"/>
                    </td>
                </tr>
            </s:iterator>
            </tbody>
        </table>

    </div>

    <div>
        <input type="hidden" name="projectCode" id="projectCode" value="<s:property value='projectCode' />"/>
        <input type="hidden" name="schemeCode" id="schemeCode" value="<s:property value='schemeCode' />"/>
        <input type="hidden" name="resultName" id="resultName" value="<s:property value='kv.resultName' />"/>
    </div>
</form>
<div style="text-align:center;margin:0 auto; ">
    <input class="inputButton" type="button" onclick="reportData()" value="导出报告">
    <input class="inputButton subButton" type="button" onclick="popdown('reportAoi');" value="关闭">
</div>

</body>
<ism:script type="text/javascript" src="../js/jquery.min.js"></ism:script>
<ism:script type="text/javascript" src="../js/colorConversion.js" debug="false"></ism:script>
<ism:script type="text/javascript" src="../js/common.js" debug="false"></ism:script>
<ism:script type="text/javascript" src="../js/popSelect.js"></ism:script>
<ism:script type="text/javascript" src="../js/eye_core.js" debug="false"></ism:script>
<ism:script type="text/javascript" src="../js/artDialog4.1.7/artDialog.js"></ism:script>
<ism:script type="text/javascript" src="../js/artDialog4.1.7/plugins/iframeTools.js"></ism:script>
<script type="text/javascript">
    var schemeQuestions = null; //方案的问卷信息
    var results = null; //被试信息
    var row = 0; //被试信息行数
    var column = 0; //被试信息的属性列数
    $(function () {
    });

    function reportData(){
        let projectCode = $("#projectCode").val();
        let schemeCode = $("#schemeCode").val();
        console.info("projectCode = "+projectCode);
        console.info("schemeCode = "+schemeCode);
    }

    /**
     * 执行修改AOI信息
     */
    function modify() {
        var aoiGraph = top.schemeAoiGraphs[top.modifyAoiIndex];
        aoiGraph.showName = $("#modify_aoi_showname").val();

        aoiGraph.strokeStyle = $("#cfg_aoi_color").val();
        aoiGraph.fillStyle = $("#cfg_aoi_color").val().colorRgba($("#cfg_aoi_diaphaneity").val());

        var inputPara = {
            "projectCode": $("#projectCode").val(),
            "schemeCode": $("#schemeCode").val(),
            "thePageAoiGraph": JSON.stringify(aoiGraph)
        };
        callJsonDataBySync("analysis_modifyAoi.action", inputPara, modifySuccessFunction, loadErrorFunction);
    }

    /**
     * 修改被试信息成功时的回调
     */
    function modifySuccessFunction(retListJson) {
        top.ownDraw(); //修改后重新绘制
        popdown('modifyAoi');
    }

    /**
     * 修改被试信息错误时的回调
     */
    function loadErrorFunction(status) {
        if (status != "success") {
            popalert({
                "content": "系统忙，请稍后重试！",
                "icon": "warning",
                "okVal": "确定",
                "cancel": false
            });
        }
    }

    /**
     * 导出AOI数据
     */
    function exportData() {
        top.exportAoiGraphs();
        popdown('modifyAoi');
    }
</script>
</html>